home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
- Global Const AppName = "Tabbed Dialog"
- Global Const tsafLanguages = False
- Global Const Version = "1.00.000"
- Global Const OneAppOnly = True
-
- Dim DlgCount As Integer
-
- Dim Dlgs() As Control
-
- Sub TabsClick (MyDlg As PictureBox, x As Single, y As Single)
- Dim oSM As Integer, th As Integer, tc As Integer, i As Integer
- th = MyDlg.TextHeight("Qq")
- If y < th + 1 Then
- tc = x \ MyDlg.ScaleWidth / (DlgCount + 1)
- Dlgs(tc).ZOrder 0
- End If
- End Sub
-
- Sub TabsPaint (MyForm As Form)
- Dim i As Integer, oSM As Integer, th As Integer, tfw As Integer, j As Integer
- Dim k As Integer
- Dim MyControl As Control
- ReDim MyCaptions(0) As String
- DlgCount = 0
- For i = 0 To MyForm.Controls.Count - 1
- If TypeOf MyForm.Controls(i) Is PictureBox Then
- If Len(MyForm.Controls(i).Tag) Then
- ReDim Preserve MyCaptions(DlgCount)
- ReDim Preserve Dlgs(DlgCount)
- MyCaptions(DlgCount) = MyForm.Controls(i).Tag
- Set Dlgs(DlgCount) = MyForm.Controls(i)
- DlgCount = DlgCount + 1
- End If
- End If
- Next i
- DlgCount = DlgCount - 1
- For i = 0 To DlgCount
- Set MyControl = Dlgs(i)
- MyControl.AutoRedraw = True
- MyControl.BorderStyle = 0
- oSM = MyControl.ScaleMode
- MyControl.ScaleMode = 3
- If th = 0 Then
- th = MyControl.TextHeight("Qq") + 1
- tfw = MyControl.ScaleWidth / (DlgCount + 1) - 1
- End If
- MyControl.Line (0, th)-(MyControl.ScaleWidth - 1, MyControl.ScaleHeight - 1), 0, B
- MyControl.Line (1, th + 1)-(MyControl.ScaleWidth - 2, th + 1), QBColor(15)
- MyControl.Line (1, th + 1)-(1, MyControl.ScaleHeight - 2), QBColor(15)
- MyControl.Line (MyControl.ScaleWidth - 2, th + 1)-(MyControl.ScaleWidth - 2, MyControl.ScaleHeight - 2), QBColor(8)
- MyControl.Line (1, MyControl.ScaleHeight - 2)-(MyControl.ScaleWidth - 1, MyControl.ScaleHeight - 2), QBColor(8)
- For k = 0 To DlgCount
- If k = j Then
- MyControl.Line (k * tfw + 1, th)-((k + 1) * tfw, th), QBColor(7)
- MyControl.Line (k * tfw + 2, th + 1)-((k + 1) * tfw - 1, th + 1), QBColor(7)
- MyControl.ForeColor = 0
- Else
- MyControl.ForeColor = QBColor(8)
- End If
- MyControl.Line (k * tfw, th)-(k * tfw + 5, 0), 0
- MyControl.Line (k * tfw + 1, th)-(k * tfw + 6, 0), QBColor(15)
- MyControl.Line (k * tfw + 5, 0)-((k + 1) * tfw - 5, 0), 0
- MyControl.Line (k * tfw + 6, 1)-((k + 1) * tfw - 5, 1), QBColor(15)
- MyControl.Line ((k + 1) * tfw - 5, 0)-((k + 1) * tfw, th), 0
- MyControl.Line ((k + 1) * tfw - 5, 2)-((k + 1) * tfw - 1, th + 1), QBColor(8)
- MyControl.CurrentY = 1
- MyControl.CurrentX = ((2 * k + 1) * tfw - MyControl.TextWidth(MyCaptions(k))) / 2
- MyControl.Print MyCaptions(k)
- Next k
- j = j + 1
- MyControl.ZOrder 0
- MyControl.ScaleMode = oSM
- Next i
- Set MyControl = Nothing
- End Sub
-
-